"""
author：wang tian cheng
date: 2020/10/20
project: ludingji
"""
##########第一题#############
# money1=float(input("存入金额："))
# money2=float(input("目标金额："))
# l=float()
# y=int()
# while money1<money2 :
#     y+=1
#     a=1
#     l=money1*0.05*a
#     money1+=l
#     print("第",y,"年的本金和利息有",money1)
# print("利息一共有：",l,"需要",y,"年")

########第二题##############
# while True:
#     pm=input("请输入接收pm2.5的值，退出请按Q:  ")
#     if pm.isdigit():
#         if 0<=int(pm) and int(pm)<51:
#             print("优")
#         elif 51<=int(pm) and int(pm)<101:
#             print("良")
#         elif 101<=int(pm) and 151>=int(pm):
#             print("轻度污染")
#         elif 151<=int(pm) and 201>int(pm):
#             print("中度污染")
#         elif 201<=int(pm) and 300>int(pm):
#             print("重度污染")
#         elif float(pm)>300:
#             print("严重污染")
#     else:
#         if pm=='Q':
#             break
#         else:
#             print("请输入正确的值")

###############第三题########################
import random
money=int(1000)
while True:
    a = int(random.randint(1, 6))
    b = int(random.randint(1, 6))
    c = int(random.randint(1, 6))
    print("您还有",money,"个金豆")
    guess=input("买定离手，挑一个吧,按exit退出：  ")
    if money<100:
        break
    if guess.isalpha():
        if 3<=(a+b+c) and 10>=(a+b+c) and guess=="大":
            print(a,b,c," ",a+b+c,"点小","佷遗憾您没有中")
            money-=100
        elif guess=="小"and 18>=(a+b+c) and 10<(a+b+c):
            print(a,b,c," ",a+b+c,"点大","佷遗憾您没有中")
            money-=100
        elif guess=="大" and 18>=(a+b+c) and 10<(a+b+c):
            print(a,b,c," ",a+b+c,"点大","恭喜中奖")
            money+=100
        elif guess=="小" and 10>=(a+b+c) and 3<=(a+b+c):
            print(a,b,c," ",a+b+c,"点小","恭喜中奖")
            money+=100
        elif guess == 'exit':
            break
        else:
            print("这是买大小游戏，要从'大'或'小'里选一个")
    else:
        print("请输入正确的值")

#################第四题################

# grade=input("输入你的成绩： ")
# for i in range(1):
#     if grade.isdigit():
#         if 0 <= int(grade) and 100 >= int(grade):
#             pass
#         else:
#             print("请输入1-100的数字")
#         if 0 <= int(grade) and int(grade) < 60:
#             print("不及格")
#         elif 60 <= int(grade) and 85 > int(grade):
#             print("良好")
#         elif 85 <= int(grade) and 100 >= int(grade):
#             print("优秀")
#     else:
#         print("请输入1-100的数字")

